package com.project.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * Result Code Enum
 */
@Getter
@AllArgsConstructor
public enum ResultCode {
    /**
     * SUCCESS
     */
    SUCCESS(HttpStatus.OK.value(), "Operation is Successful"),
    FAILURE(HttpStatus.BAD_REQUEST.value(), "Biz Exception"),

    UN_AUTHORIZED(HttpStatus.UNAUTHORIZED.value(), "Request Unauthorized"),

    NOT_FOUND(HttpStatus.NOT_FOUND.value(), "404 Not Found"),

    MSG_NOT_READABLE(HttpStatus.BAD_REQUEST.value(), "Message Can't be Read"),

    METHOD_NOT_SUPPORTED(HttpStatus.METHOD_NOT_ALLOWED.value(), "Method Not Supported"),

    MEDIA_TYPE_NOT_SUPPORTED(HttpStatus.UNSUPPORTED_MEDIA_TYPE.value(), "Media Type Not Supported"),

    REQ_REJECT(HttpStatus.FORBIDDEN.value(), "Request Rejected"),

    INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR.value(), "Internal Server Error"),

    PARAM_MISS(HttpStatus.BAD_REQUEST.value(), "Missing Required Parameter"),

    PARAM_TYPE_ERROR(HttpStatus.BAD_REQUEST.value(), "Parameter Type Mismatch"),

    PARAM_BIND_ERROR(HttpStatus.BAD_REQUEST.value(), "Parameter Binding Error"),

    PARAM_VALID_ERROR(HttpStatus.BAD_REQUEST.value(), "Parameter Validation Error");

    final int code;

    final String msg;
}
